package com.example.project_board.controller;


import com.example.project_board.mapper.SuggestionMapper;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.http.ResponseEntity;
import org.springframework.web.bind.annotation.*;
import org.springframework.web.servlet.ModelAndView;

import java.util.Map;

@RestController
public class DeleteSug {
    @Autowired
    private SuggestionMapper suggestionMapper;
    @RequestMapping("/delete-comment")
    @ResponseBody
    public ResponseEntity<String> deletesug(@RequestBody Map<String, String> request){
        String talking = request.get("talk");
        System.out.println(talking);
        suggestionMapper.deletesug(talking);
        return ResponseEntity.ok("Comment deleted successfully");
    }

}
